home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / enved10.zip / ENVED.TXT < prev    next >
Text File  |  1994-07-01  |  11KB  |  262 lines

  1.                                     ENVED
  2.                          Environment Editor for DOS
  3.                                  Version 1.0
  4.  
  5.                             Instructions For Use
  6.  
  7.    -------------------------------------------------------------------------
  8.    Copyright (c) 1994 Paul M. Parks
  9.    All Rights Reserved
  10.  
  11.    THE AUTHOR, PAUL M. PARKS, DISCLAIMS ALL WARRANTIES RELATING TO THIS
  12.    SOFTWARE, WHETHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
  13.    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  14.    PURPOSE.  THE AUTHOR OF THIS SOFTWARE WILL NOT BE LIABLE FOR ANY DAMAGES
  15.    ARISING FROM THE USE OF OR INABILITY TO USE THIS SOFTWARE.
  16.  
  17.  
  18.    MS-DOS and Windows are trademarks of the Microsoft Corporation.
  19.  
  20.    OS/2 is a trademark of the IBM Corporation.
  21.  
  22.    NDOS is a trademark of the Symantec Corporation.
  23.  
  24.    -------------------------------------------------------------------------
  25.  
  26.  
  27.                            -- SHAREWARE LICENSE --
  28.  
  29.    The user is granted one license to use this shareware software for a
  30.    30-day evaluation period, beginning at the time of first use, for the
  31.    express purpose of determining whether or not this software is suitable
  32.    for the user's purposes.  At the end of this 30-day evaluation period,
  33.    the user must either purchase a license for continued use of the
  34.    software, or discontinue its use.  Any usage beyond this 30-day
  35.    evaluation period will be a violation of this license.
  36.  
  37.    This unregistered copy of ENVED may be freely distributed as long as the
  38.    files ENVED.EXE, ENVED.TXT, and ENVEDREG.TXT are distributed together
  39.    and as long as none of these files have been added to, modified, or
  40.    tampered with in any way.
  41.  
  42.  
  43.                              -- INTRODUCTION --
  44.  
  45.    I created ENVED as a means of easily changing environment variables in
  46.    MS-DOS and making the changes stick once and for all.  Often I would
  47.    change an INCLUDE variable, or make a change to my PATH, and then have to
  48.    make the change all over again the next time I booted my PC because I had
  49.    forgotten to update the variable in my AUTOEXEC.BAT file.  With ENVED, I
  50.    make a change once and forget about it.
  51.  
  52.    Most users may never have to worry about changing their environment.
  53.    However, developers, technicians, and good old-fashioned power users
  54.    often have to very carefully manage environment variables and may
  55.    frequently need to adjust their values.  It is for these users that ENVED
  56.    is designed.
  57.  
  58.  
  59.                            -- HOW TO USE ENVED --
  60.  
  61.    Basic Usage - Changing Variables
  62.    --------------------------------
  63.  
  64.    Using ENVED is very similar to using the DOS command SET.  However, ENVED
  65.    will make environment variable changes endure even after the computer is
  66.    turned off by updating the corresponding SET command in AUTOEXEC.BAT.
  67.  
  68.    For example, to set the INCLUDE variable, one may type
  69.  
  70.       ENVED INCLUDE C:\LANG\INCLUDE;C:\SOURCE\MYPROJ\INCLUDE;
  71.  
  72.    (Notice that no equals sign is used, as it is in SET).  This command line
  73.    will set the INCLUDE variable to the value provided, and change any
  74.    occurrence of
  75.  
  76.       SET INCLUDE=somevalue
  77.  
  78.    in AUTOEXEC.BAT to
  79.  
  80.       SET INCLUDE=C:\LANG\INCLUDE;C:\SOURCE\MYPROJ\INCLUDE;
  81.  
  82.    Before ENVED makes any changes to AUTOEXEC.BAT it copies your current
  83.    file to AUTOEXEC.ENV to preserve your original settings.
  84.  
  85.    If a variable has already been assigned a value, but you want to update
  86.    AUTOEXEC.BAT with that value, you may use the /u option to make the
  87.    change for you.
  88.  
  89.       ENVED /U NEWVAR
  90.  
  91.    If the variable NEWVAR is not defined in the environment, ENVED will
  92.    print a warning to that effect.
  93.  
  94.  
  95.    Adding Variables
  96.    ----------------
  97.  
  98.    If the AUTOEXEC.BAT file does not have a SET command for the variable you
  99.    specified on the ENVED command line, one will be added to the file.  The
  100.    first time a variable is added, two comments will be created around the
  101.    variable.  Every subsequent addition will be made inside these two
  102.    comments.  For example, if you were to add the TEMP variable to your
  103.    AUTOEXEC.BAT file with the value C:\TMP, and you had never added a
  104.    variable to your batch file with ENVED before, you would see the
  105.    following lines at the end of AUTOEXEC.BAT:
  106.  
  107.       rem ENVED_SET_START
  108.       SET TEMP=C:\TMP
  109.       rem ENVED_SET_END
  110.  
  111.    Any variables you add afterwards will be inserted just before the
  112.    ENVED_SET_END remark line.  This can be useful in a couple of ways.
  113.    First, if you like to keep all of your environment variable definitions
  114.    in one place (a good idea), you can enclose this section of your
  115.    AUTOEXEC.BAT file in the above comments.  Then, anytime you add a
  116.    variable you can be sure that it is in the proper place.  Second, if you
  117.    are using a boot-up menu to manage different configurations in your
  118.    AUTOEXEC.BAT, you can have more than one block of SET statements enclosed
  119.    by these remark lines.  If you add any new variables, they will be
  120.    inserted into each block found in the file.  Please remember that the
  121.    case of the remark lines is not important, and that both remark lines
  122.    must be present and in order before ENVED will recognize the block.
  123.  
  124.    These remarks do not affect the modification of existing SET statements
  125.    outside of the markers.  ENVED will always search the entire AUTOEXEC.BAT
  126.    file for a variable and modify each occurrence.
  127.  
  128.  
  129.    Removing Variables
  130.    ------------------
  131.  
  132.    Two methods may be used to remove a variable.  One is by using the /x
  133.    option to delete the variable from the environment and delete its
  134.    reference in AUTOEXEC.BAT.  Another method is to use the /r option, which
  135.    only remarks the SET command in AUTOEXEC.BAT, but still removes the
  136.    variable from the environment.  These two options cannot be used
  137.    together, nor in conjunction with the /u option.
  138.  
  139.  
  140.    Specifying The Boot Drive
  141.    -------------------------
  142.  
  143.    To change AUTOEXEC.BAT files on drives other than drive C:, use the /d
  144.    option followed by a drive letter to tell ENVED where to look for your
  145.    AUTOEXEC.BAT file.  For example, if you were booting from floppy drive A:
  146.    and you wanted to change your PATH variable to "A:\DOS;A:\BIN;A:\;", you
  147.    would type the following:
  148.  
  149.       ENVED /DA PATH A:\DOS;A:\BIN;A:\;
  150.  
  151.    This would update A:\AUTOEXEC.BAT with the new path and change your
  152.    environment copy of PATH to the new value.  This option may also be used
  153.    with the /x, /r, and /u options.
  154.  
  155.  
  156.    Assigning Variables to Variables
  157.    --------------------------------
  158.  
  159.    You may include environment variables in the value section of the ENVED
  160.    command line (e.g., ENVED USERNAME %USER%).  These variables will be
  161.    evaluated before being written to the environment, but the SET command in
  162.    AUTOEXEC.BAT will be written with the variable name intact.  This way,
  163.    the value may be evaluated each time AUTOEXEC.BAT is executed.  One word
  164.    of caution is in order, however:  make sure that the variable being
  165.    evaluated on the right-hand side of the SET statement is defined before
  166.    the variable you are generating is defined.
  167.  
  168.  
  169.    For example, this is correct:
  170.  
  171.       SET TOOLINC=C:\COOLTOOL\SRC\INCLUDE
  172.       SET INCLUDE=C:\LANG\INCLUDE;%TOOLINC%;
  173.  
  174.  
  175.    This results in an incorrect assignment:
  176.  
  177.       SET INCLUDE=C:\LANG\INCLUDE;%TOOLINC%;
  178.       SET TOOLINC=C:\COOLTOOL\SRC\INCLUDE
  179.  
  180.  
  181.    PATH And PROMPT
  182.    ---------------
  183.  
  184.    These variables are unique because they may be assigned either by a SET
  185.    command or by the DOS commands PATH and PROMPT, respectively.  ENVED will
  186.    sense which method is used to assign these values in AUTOEXEC.BAT and
  187.    update the file accordingly.
  188.  
  189.  
  190.                             -- HOW ENVED WORKS --
  191.  
  192.    The ENVED program changes the DOS environment by creating a temporary
  193.    batch file that sets the environment variable and then deletes itself.
  194.    This batch file is run as soon as ENVED stops executing.  The reason a
  195.    batch file is used is that DOS